------------------------------------------------------------------------------------------------------------------------------------
      name:  plog_751
       log:  /accounts/projects/jr_ra/GRscarring/erratum/programs/prepare/makemorg2019.log
  log type:  text
 opened on:  27 Nov 2024, 17:23:40

. /*
> Variables we'd need for MORG 2019 extract
> 
> intmonth.   raworg.           hrmonth
> minsamp.    raworg.           hrmis
> lineno.     raworg.           pulineno
> weight.     raworg.           pwsswgt
> hhid.       raworg.           hrhhid
> hhnum.      raworg.           5th digit of hrhhid2
> class94.    raworg            peio1cow
> occ2012.    raworg            peio1ocd
> stfips.     raworg.           gestfips
> year.       raworg            hryear4
> sex.        raworg            pesex
> marital.    raworg            pemaritl
> hurespli.   raworg            <same>
> grade92.    raworg            peeduca
> lfsr94.     raworg            pemlr
> paidhre.    raworg            peernhry
> earnhre.    raworg            prernhly
> prhernal.   ??? alloc only
> pwernal.    ??? alloc only
> peernhry.   ??? alloc only
> earnwke                       prernwa
> uhourse                       peernhro                       
> ftpt94                        prwkstat
> hourslw                       pehractt
> peio1ocd                      peio1ocd
> */
. 
. cap project, doinfo

. if _rc==0 {
.         local doasproject=1
.         local pdir "`r(pdir)'"                                                      // the project's main dir.
.         local dofile "`r(dofile)'"                                                  // do-file's stub name
.   local sig {bind:{hi:[RP : `dofile'.do]}}      // a signature in notes
. }

. else {
.   local doasproject=0
.         local pdir "~/GRscarring"
.         local dofile "makemorg2019"
.         local sig "Not run as part of project!"
. }

. 
. local cpsorig "`pdir'/rawdata/readrawcps/bigcps"

. local intermediate "`pdir'/scratch"

. local otherraw "`pdir'/rawdata"

. 
. forvalues m=1/12 {
  2.   if `m'<10 local mo "0`m'"
  3.   else local mo "`m'"
  4.   local origfile "cpsb19`mo'"
  5. 
.    *Read in the data;
.     if `doasproject'==1 project, original("`cpsorig'/`origfile'.dta.gz")
  6.     !zcat `cpsorig'/`origfile'.dta.gz > `intermediate'/tmp_`origfile'.dta
  7.     use hrmonth hrmis pulineno pwsswgt pworwgt hrhhid hrhhid2 peio1cow peio1ocd ///
>         gestfips hryear4 pesex pemaritl hurespli peeduca pemlr peernhry prernhly ///
>         prernwa pehrusl1 prwkstat pehractt prtage ///
>         if (hrmis==4 | hrmis==8) & prtage>=16 using `intermediate'/tmp_`origfile'.dta, clear
  8.     !rm -f `intermediate'/tmp_`origfile'.dta
  9.   tempfile month`m'
 10.   save `month`m''
 11. }
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1901.dta
> .gz" filesig(994181011:10765361)


file /tmp/St2868349.000004 saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1902.dta
> .gz" filesig(3528513143:10673081)


file /tmp/St2868349.000005 saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1903.dta
> .gz" filesig(1838804196:10581643)


file /tmp/St2868349.000006 saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1904.dta
> .gz" filesig(3087391980:10573595)


file /tmp/St2868349.000007 saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1905.dta
> .gz" filesig(1824975582:10463453)


file /tmp/St2868349.000008 saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1906.dta
> .gz" filesig(2781178:10561904)


file /tmp/St2868349.000009 saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1907.dta
> .gz" filesig(1926904206:10476279)


file /tmp/St2868349.00000a saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1908.dta
> .gz" filesig(4216338693:10533560)


file /tmp/St2868349.00000b saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1909.dta
> .gz" filesig(4132827308:10478042)


file /tmp/St2868349.00000c saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1910.dta
> .gz" filesig(380766638:10505817)


file /tmp/St2868349.00000d saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1911.dta
> .gz" filesig(3073131277:10419397)


file /tmp/St2868349.00000e saved as .dta format
project GRscar_erratum > do-file uses original: "/scratch/public/jr_ra/GRscarring2024/erratum/rawdata/readrawcps/bigcps/cpsb1912.dta
> .gz" filesig(3358381423:10439952)


file /tmp/St2868349.00000f saved as .dta format

. use `month1'

. forvalues m=2/12 {
  2.   append using `month`m''
  3. }
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)
(label gestfips already defined)
(label prtage already defined)
(label pemaritl already defined)
(label pesex already defined)
(label peeduca already defined)
(label pemlr already defined)
(label pehrusla already defined)
(label prwkstat already defined)
(label peio1cow already defined)
(label peernhry already defined)
(label peio1ocd already defined)

. rename prtage age

. rename hrmonth intmonth

. rename hrmis minsamp

. rename pulineno lineno

. rename pwsswgt weight

. rename pworwgt earnwt

. rename hrhhid hhid

. rename peio1cow class94

. rename peio1ocd occ2012

. rename gestfips stfips

. rename hryear4 year

. rename pesex sex

. rename pemaritl marital

. rename peeduca grade92

. rename pemlr lfsr94

. rename peernhry paidhre

. rename prernhly earnhre

. replace earnhre=earnhre*100
(89,848 real changes made)

. rename prernwa earnwke

. rename pehrusl1 uhourse

. replace uhourse=. if uhourse<0
(129,539 real changes made, 129,539 to missing)

. rename prwkstat ftpt94

. rename pehractt hourslw

. replace hourslw=. if hourslw<0
(124,283 real changes made, 124,283 to missing)

. gen byte hhnum=real(substr(hrhhid2,5,1))

. 
. save `intermediate'/morg2019.dta, replace
(file /accounts/projects/jr_ra/GRscarring/erratum/scratch/morg2019.dta not found)
file /accounts/projects/jr_ra/GRscarring/erratum/scratch/morg2019.dta saved

. 
. if `doasproject'==1 project, creates("`intermediate'/morg2019.dta")
project GRscar_erratum > do-file creates: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/morg2019.dta" filesig(1601100515:213
> 32162)

. 
. 
. 
end of do-file
      name:  plog_751
       log:  /accounts/projects/jr_ra/GRscarring/erratum/programs/prepare/makemorg2019.log
  log type:  text
 closed on:  27 Nov 2024, 17:23:59
------------------------------------------------------------------------------------------------------------------------------------
